package com.weijing.pretty_app.activity

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.jeremyliao.liveeventbus.LiveEventBus
import com.weijing.pretty_app.databinding.ActivityMenuSelectBinding
import com.weijing.pretty_app.models.SelectModel
import com.weijing.pretty_app.util.EdgeToEdgeHelper
import com.weijing.pretty_app.util.KeyUtil

/**
 * 功能选择页面
 * 脱毛 & 皮肤页面
 */
class MenuSelectActivity : BaseActivity() {

    private val binding by lazy { ActivityMenuSelectBinding.inflate(layoutInflater) }
    override fun getMainView(): View = binding.main

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        EdgeToEdgeHelper.setupEdgeToEdge(window)

        initClick()
    }

    private fun initClick() {
        //脱毛
        binding.menuSelectLl1.setOnClickListener {
            LiveEventBus.get<SelectModel>(KeyUtil.TO_TuoMaoModelActivity)
                .post(SelectModel(model1 = KeyUtil.TUO_MAO_))
            val intent = Intent(this@MenuSelectActivity, TuoMaoModelActivity::class.java)
            startActivity(intent)
        }

        //嫩肤
        binding.menuSelectLl2.setOnClickListener {
            LiveEventBus.get<SelectModel>(KeyUtil.TO_NenFuNextActivity)
                .post(SelectModel(model1 = KeyUtil.NEN_FU_))
            val intent = Intent(this@MenuSelectActivity, NenFuNextActivity::class.java)
            startActivity(intent)
        }

        //设置
        binding.menuSelectIvSetting.setOnClickListener {
            startActivity(Intent(this@MenuSelectActivity, MineActivity::class.java))
        }
    }
}